const myDb = require('../../../libs/mydb');

module.exports = {

    //报表 传年份值datatime 如2021，传收入或支出类型  
    report_form: async function(req, res){
        let { datatime, flage, uid} = req.query;
        await myDb.singleSearch('ac_money_tb','con_time,mo_money'
        ,`WHERE mo_flage=${flage} AND uid=${uid} AND con_time LIKE '${datatime}%' ORDER BY con_time DESC`)
            .then(
                result =>{
                    if(result){
                        res.send({
                            code:200,
                            msg:'success',
                            reportData:result 
                        })
                    } else {
                        res.send({
                            code:400,
                            msg:'No report'
                        })
                    }
                }
            )
    }

    
}